<template>
  <div>
  <div  class="homeContainer">
      <div  style=" display: flex; height: 60px; line-height: 60px; align-items: center;">
      <div style=" display: flex; align-items: center; margin-left: 30px;cursor: pointer;">

        <div>学成平台</div>
      </div >


        <div  style=" display: flex; align-items: center; margin-left: auto; margin-right: 20px; ">
          <li>admin</li>
        </div>
    </div>
  </div>
    <el-container>
      
        <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
         
              <el-menu  
              router
              default-active="1" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
            
                <!-- 一级菜单 -->
                <el-menu-item v-for="item in menus" :index="item.link" :key="item.id">
                  <template slot="title" >
                    <i class="item.icon"></i>
                    <span>{{item.name}}</span>
                  </template>
                </el-menu-item> 
            
              </el-menu>
              <template>

            </template>
           
        </el-aside>
        <el-main>
          <router-view></router-view>  
        </el-main>
        
    </el-container>
  </div>
</template>

<script>
export default {
    data(){
      return {
        menus: [],
      }
    },
    methods:{
      queryMenus() {

      this.$axios.get('api/background/menuBackground')
        .then(res => {
          console.log(res.data)
          this.menus = res.data
        })
    },

    },
    created() {
        this.queryMenus();
    }
}
</script>

<style lang="scss" scoped>
*{
  margin: 0;
  padding: 0;
}
.homeContainer {
  background-color: #017bc4;
  li {
    list-style-type: none;
    padding: 0 10px;
    cursor: pointer;
    &:hover {
      background-color: rgba(0, 0, 0, 0.124);
    }
  }
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 200px;
    margin: 0;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
  
  }
  .el-container{
    height: calc(100% - 60px);
  }
  .el-menu{
    height: 100%;
  }
</style>